# coding: utf-8

puts "全局方法调用，Technically,however,a method like this becomes a private method of the Object class。"
def square(x)
	x * x
end
puts square(2)

puts "\n定义类型方法，singleton methods或者叫class methods。"
def Math.square(x)
	x*x
end
puts Math.square(2)

puts "\n方法的后缀，?号会返回bool类型，代表了一个断言；!代表了副总用。"
arr = [1, 3 , 2]

puts arr.empty?

arr.sort
puts arr

arr.sort!
puts arr


